<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0028)http://jdbi.org/archive.html -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>


<title>abacus-common</title>

<script type="text/javascript" src="./css/ga.js"></script>
<script type="text/javascript">
	if (top.location != self.location)
		top.location.replace(self.location);
</script>

<link href="./css/css" rel="stylesheet" type="text/css"></link>
<link href="./css/css(1)" rel="stylesheet" type="text/css"></link>
<link rel="stylesheet" href="./css/syntax.css" type="text/css"></link>
<link rel="stylesheet" href="./css/screen.css" type="text/css"></link>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-65247258-1', 'auto');
  ga('send', 'pageview');
</script>

</head>
<body>
	<div id="site">
		<h1>
			<a href="./index.html">abacus-common</a> <span id="navigation"> <a href="./docs.html">Docs</a> | <a href="./download.html">Download</a>
				| <a href="./api-docs/index.html">Javadoc</a> | <a href="./faq.html">FAQ</a> | <a href="./community.html">Community</a>
			</span>
		</h1>
	</div>

	<div id="content">

		<div id="page">
		
			<h1>Profiler</h1>
			<p><a href="./Profiler_view.html">Profiler</a> is a simple utility class for method performance test</p>
			
<!-- HTML generated using hilite.me --><div style="background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%">Profiler<span style="color: #666666">.</span><span style="color: #7D9029">run</span><span style="color: #666666">(</span>threadNum<span style="color: #666666">,</span> loopNum<span style="color: #666666">,</span> repeatNum<span style="color: #666666">,</span> <span style="color: #BA2121">&quot;yourMethod&quot;</span><span style="color: #666666">,</span> <span style="color: #666666">()</span> <span style="color: #666666">-&gt;</span> <span style="color: #666666">{</span>
    <span style="color: #408080; font-style: italic">/* call your method */</span><span style="color: #666666">}).</span><span style="color: #7D9029">printResult</span><span style="color: #666666">();</span>

<span style="color: #408080; font-style: italic">// call by method.</span>
Profiler<span style="color: #666666">.</span><span style="color: #7D9029">run</span><span style="color: #666666">(</span>instance<span style="color: #666666">,</span> <span style="color: #BA2121">&quot;yourMethod&quot;</span><span style="color: #666666">,</span> threadNum<span style="color: #666666">,</span> loopNum<span style="color: #666666">,</span> repeatNum<span style="color: #666666">).</span><span style="color: #7D9029">printResult</span><span style="color: #666666">();</span>

<span style="color: #408080; font-style: italic">//call by Runnable and write result to Console with html format</span>
Profiler<span style="color: #666666">.</span><span style="color: #7D9029">run</span><span style="color: #666666">(</span>threadNum<span style="color: #666666">,</span> loopNum<span style="color: #666666">,</span> repeatNum<span style="color: #666666">,</span> <span style="color: #666666">()</span> <span style="color: #666666">-&gt;</span> <span style="color: #666666">{</span>
    <span style="color: #408080; font-style: italic">/* call your method */</span><span style="color: #666666">}).</span><span style="color: #7D9029">writeHtmlResult</span><span style="color: #666666">(</span>System<span style="color: #666666">.</span><span style="color: #7D9029">out</span><span style="color: #666666">);</span>

<span style="color: #408080; font-style: italic">//call by method and write result to Console with html format</span>
Profiler<span style="color: #666666">.</span><span style="color: #7D9029">run</span><span style="color: #666666">(</span>instance<span style="color: #666666">,</span> <span style="color: #BA2121">&quot;yourMethod&quot;</span><span style="color: #666666">,</span> threadNum<span style="color: #666666">,</span> loopNum<span style="color: #666666">,</span> repeatNum<span style="color: #666666">).</span><span style="color: #7D9029">writeHtmlResult</span><span style="color: #666666">(</span>System<span style="color: #666666">.</span><span style="color: #7D9029">out</span><span style="color: #666666">);</span>
</pre></div>



		<p></p>
		<p>Here is the result with plain text format:</p>
<!-- HTML generated using hilite.me --><div style="background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #666666">========================================================================================================================</span>
<span style="color: #666666">(</span><span style="color: #A0A000">unit:</span> milliseconds<span style="color: #666666">)</span>
threadNum<span style="color: #666666">=16;</span> loops<span style="color: #666666">=100000</span>
<span style="color: #A0A000">totalElapsedTime:</span> <span style="color: #666666">2258</span>


<span style="color: #666666">&lt;</span>method name<span style="color: #666666">&gt;,</span>  <span style="color: #666666">|</span>avg time<span style="color: #666666">|,</span> <span style="color: #666666">|</span>min time<span style="color: #666666">|,</span> <span style="color: #666666">|</span>max time<span style="color: #666666">|,</span> <span style="color: #666666">|0.01%</span> <span style="color: #666666">&gt;=|,</span> <span style="color: #666666">|0.1%</span> <span style="color: #666666">&gt;=|,</span>  <span style="color: #666666">|1%</span> <span style="color: #666666">&gt;=|,</span>    <span style="color: #666666">|10%</span> <span style="color: #666666">&gt;=|,</span>   <span style="color: #666666">|20%</span> <span style="color: #666666">&gt;=|,</span>   <span style="color: #666666">|50%</span> <span style="color: #666666">&gt;=|,</span>   <span style="color: #666666">|80%</span> <span style="color: #666666">&gt;=|,</span>   <span style="color: #666666">|90%</span> <span style="color: #666666">&gt;=|,</span>   <span style="color: #666666">|99%</span> <span style="color: #666666">&gt;=|,</span>   <span style="color: #666666">|99.9%</span> <span style="color: #666666">&gt;=|,</span> <span style="color: #666666">|99.99%</span> <span style="color: #666666">&gt;=|</span>
yourMethod<span style="color: #666666">,</span>      <span style="color: #666666">0.0109,</span>     <span style="color: #666666">0,</span>          <span style="color: #666666">126,</span>        <span style="color: #666666">1,</span>          <span style="color: #666666">1,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          <span style="color: #666666">0,</span>          

<span style="color: #666666">========================================================================================================================</span>
</pre></div>

		
		
		<p></p>
		<p>Here is the result with html format:</p>
		
========================================================================================================================
<br/>(unit: milliseconds)
<br/>threadNum=16; loops=100000
<br/>totalElapsedTime: 2172
<br/>
<br/>
<table width="600" border="1">
<tr>
<th>method name</th>
<th>avg time</th>
<th>min time</th>
<th>max time</th>
<th>0.01% &gt;=</th>
<th>0.1% &gt;=</th>
<th>1% &gt;=</th>
<th>10% &gt;=</th>
<th>20% &gt;=</th>
<th>50% &gt;=</th>
<th>80% &gt;=</th>
<th>90% &gt;=</th>
<th>99% &gt;=</th>
<th>99.9% &gt;=</th>
<th>99.99% &gt;=</th>
</tr>
<tr>
<td>yourMethod</td>
<td>0.0103</td>
<td>0</td>
<td>130</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</table>
========================================================================================================================

			

		</div>

	</div>
</body>

</html>